/** 
* All Rights Reserved , Copyright (C) 2021 , 青岛鼎信通讯股份有限公司
* 
* SdProjectTaskServiceAuto
* SD项目策划-任务
* 
* 修改纪录
* 2021-12-16 版本：1.0 hudeyong 创建。
* @version 版本：1.0
* @author 作者：hudeyong
* 创建日期：2021-12-16
*/

package com.topscomm.gpm.service.impl.auto;

import javax.annotation.Resource;
import com.topscomm.basic.IBasicDao;
import com.topscomm.tap.common.DatacodeCache;
import java.util.Map;
import com.topscomm.gpm.*;
import com.topscomm.gpm.pojo.GpmProjectTaskEntity;
import com.topscomm.gpm.dao.IGpmProjectTaskDao;


public class GpmProjectTaskServiceAuto extends GpmService<GpmProjectTaskEntity, IGpmProjectTaskDao> {
	
	/**
	 * @author: hudeyong
	 * @date: 2021-12-16
	 * @param mapRow
	 * @description:设置字段显示值
	 * @modify:
	 */
	@Override
	public void setDispFields(Map<String, Object> mapRow, DatacodeCache datacodeCache) {
		String temp;
		if (mapRow.get("deptcommoncode1") != null) {
			temp = mapRow.get("deptcommoncode1").toString();
			mapRow.put("dispdeptcommoncode1", datacodeCache.getValueDynamic("DeptCommonCode", temp, "code", "name"));
		}
		if (mapRow.get("flowid") != null) {
			temp = mapRow.get("flowid").toString();
			mapRow.put("dispflowid", datacodeCache.getValueDynamic("ApprovalFlow_GpmProjectTask", temp, "id", "name"));
		}
		if (mapRow.get("state") != null) {
			temp = mapRow.get("state").toString();
			mapRow.put("dispstate", datacodeCache.getValueDynamic("TapApprovalBillState", temp, "code", "name"));
		}
		if (mapRow.get("enabled") != null) {
			temp = mapRow.get("enabled").toString();
			mapRow.put("dispenabled", datacodeCache.getValueDynamic("CboYesNo", temp, "code", "name"));
		}
		if (mapRow.get("taskstate") != null) {
			temp = mapRow.get("taskstate").toString();
			mapRow.put("disptaskstate", datacodeCache.getValueDynamic("GpmTaskState", temp, "code", "name"));
		}
		if (mapRow.get("tasktype") != null) {
			temp = mapRow.get("tasktype").toString();
			mapRow.put("disptasktype", datacodeCache.getValueDynamic("GpmTaskType", temp, "code", "name"));
		}
		if (mapRow.get("taskpriority") != null) {
			temp = mapRow.get("taskpriority").toString();
			mapRow.put("disptaskpriority", datacodeCache.getValueDynamic("GpmTaskPriority", temp, "code", "name"));
		}
		if (mapRow.get("productline") != null) {
			temp = mapRow.get("productline").toString();
			mapRow.put("dispproductline", datacodeCache.getValueDynamic("ProductLine", temp, "code", "name"));
		}
		if (mapRow.get("productbigtype") != null) {
			temp = mapRow.get("productbigtype").toString();
			mapRow.put("dispproductbigtype", datacodeCache.getValueDynamic("ProductCatalog1", temp, "code", "name"));
		}
		if (mapRow.get("productmiddletype") != null) {
			temp = mapRow.get("productmiddletype").toString();
			mapRow.put("dispproductmiddletype", datacodeCache.getValueDynamic("ProductCatalog2", temp, "code", "name"));
		}
		if (mapRow.get("isdelivery") != null) {
			temp = mapRow.get("isdelivery").toString();
			mapRow.put("dispisdelivery", datacodeCache.getValueDynamic("CboYesNo", temp, "code", "name"));
		}
	}

	@Override
	@Resource(name = "sdProjectTaskDao")
	public void setDao(IBasicDao<GpmProjectTaskEntity> dao) {
		super.setDao(dao);
	}
}
